const ScoreService = require('../services/ScoreService')

const ScoreController = {
  findList: async (req, res) => {
    const result = await ScoreService.findList(req.params, req.body)
    res.send({
      ActionType: 'OK',
      data: result
    })
  },

  postList: async (req, res) => {
    // console.log(req.params.courseid)
    // console.log(req.body)
    await ScoreService.postList(req.params, req.body)
    res.send({
      ActionType: 'OK'
    })
  },

  putList: async (req, res) => {
    await ScoreService.putList(req.params, req.body)
    res.send({
      ActionType: 'OK'
    })
  },

  getList: async (req, res) => {
    const result = await ScoreService.getList(req.params)
    res.send({
      ActionType: 'OK',
      data: result
    })
  },

  getNopassList: async (req, res) => {
    const result = await ScoreService.getNopassList(req.params)
    res.send({
      ActionType: 'OK',
      data: result
    })
  },

  getPublishedList: async (req, res) => {
    const result = await ScoreService.getPublishedList(req.params)
    res.send({
      ActionType: 'OK',
      data: result
    })
  }
}

module.exports = ScoreController
